package main

import (
	"github.com/gin-gonic/gin"
	"log"
	"os"
	"ys-platform/routers"
)

func main() {

	// 初始化Gin路由器
	router := gin.Default()
	// 设置路由
	//routers.SetUpAPIV1Routes(router)
	routers.UserRoutesInit(router)
	// 从环境变量获取端口
	port := os.Getenv("PORT")
	if port == "" {
		port = ":8080"
	}
	// 启动HTTP服务器
	if err := router.Run(port); err != nil {
		log.Fatalf("failed to start server: %v", err)
	}
}
